import * as web3d from "../lib/web3d";

@web3d.UserCode
export class main implements web3d.IUserCode
{
    onStart(app: web3d.application) {
        console.warn("Hello web3d!!")
    }    
    onUpdate(delta: number) {
    }
    isClosed(): boolean {
        return false;
    }
}

window.onload=()=>
{
    //web3d.Jsloader.ins.addScripte("lib/Reflect.js");
    //web3d.Jsloader.ins.addScripte("lib/gl-matrix.js");    
    // Jsloader.ins.addScripte("lib/web3d.js");
    // Jsloader.ins.addScripte("lib/code.js");

    let div = document.createElement("div");   
    div.style.position = "absolute";
    div.style.backgroundColor = "#555";
    div.style.width = "100%";
    div.style.height = "100%";
    //div.style.zIndex = "10000";
    document.body.appendChild(div);
    
    let gdapp = new web3d.application();
    //let div = document.getElementById("drawarea") as HTMLDivElement;
    gdapp.start(div);
    // web3d.StateMgr.showFps();
    //gdapp.bePlay = true;
    gdapp.addUserCode("main");
    
    // Jsloader.ins.preload(onComplete);
}

